import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const StoreListKey = 'StoreList'
const CurStoreKey = 'CurStore'
const StoreHouseListKey = 'StoreHouseList'
const CategoryDataKey = 'CategoryData'
const DictDataKey = 'DictData'
const DictDetailsDataKey = 'DictDetailsData'
const CordongetCordonGoodsDataKey = 'CordongetCordonGoods'

// 登录token
export function getToken () {
  return sessionStorage.getItem(TokenKey)
}

export function setToken (token) {
  return sessionStorage.setItem(TokenKey, token)
}

export function removeToken () {
  return sessionStorage.removeItem(TokenKey)
}

// 门店；
export function getStoreListData () {
  return sessionStorage.getItem(StoreListKey)
}

export function setStoreList (data) {
  return sessionStorage.setItem(StoreListKey, data)
}

export function removeStoreList () {
  return sessionStorage.removeItem(StoreListKey)
}
// 当前门店
export function getCurStore () {
  return sessionStorage.getItem(CurStoreKey)
}

export function setCurStore (data) {
  console.log('auth--setCurStore--data==', data);
  return sessionStorage.setItem(CurStoreKey, JSON.stringify(data));
}

export function removeCurStore () {
  return sessionStorage.removeItem(CurStoreKey)
}

// 仓库；
export function getStoreHouseListData () {
  return sessionStorage.getItem(StoreHouseListKey)
}

export function setStoreHouseList (data) {
  return sessionStorage.setItem(StoreHouseListKey, data)
}

export function removeStoreHouseList () {
  return sessionStorage.removeItem(StoreHouseListKey)
}

// 商品分类
export function getCategoryData () {
  return sessionStorage.getItem(CategoryDataKey)
}

export function setCategoryData (data) {
  return sessionStorage.setItem(CategoryDataKey, data)
}

export function removeCategoryData () {
  return sessionStorage.removeItem(CategoryDataKey)
}

// 字典列表
export function getDictData () {
  return sessionStorage.getItem(DictDataKey);
}

export function setDictData (data) {
  console.log('setDictData--data==', data);
  return sessionStorage.setItem(DictDataKey, data);
}

export function removeDictData () {
  return sessionStorage.removeItem(DictDataKey)
}
// 字典详情
export function getDictDetailsData () {
  return sessionStorage.getItem(DictDetailsDataKey)
}

export function setDictDetailsData (data) {
  return sessionStorage.setItem(DictDetailsDataKey, data)
}

export function removeDictDetailsData () {
  return sessionStorage.removeItem(DictDetailsDataKey)
}

// 字典详情
export function getCordonGoodsData () {
  return sessionStorage.getItem(CordongetCordonGoodsDataKey)
}

export function setCordonGoodsData (data) {
  return sessionStorage.setItem(CordongetCordonGoodsDataKey, data)
}

export function removeCordonGoodsData () {
  return sessionStorage.removeItem(CordongetCordonGoodsDataKey)
}
